import qrcode
# import qrcode.image.svg
# method = ''
# if method == 'basic':
#     # Simple factory, just a set of rects.
#     factory = qrcode.image.svg.SvgImage
# elif method == 'fragment':
#     # Fragment factory (also just a set of rects)
#     factory = qrcode.image.svg.SvgFragmentImage
# else:
#     # Combined path factory, fixes white space that may occur when zooming
#     factory = qrcode.image.svg.SvgPathImage
qr = qrcode.QRCode(
    version=7,
    error_correction=qrcode.constants.ERROR_CORRECT_H,
    box_size=7,
    border=6,
)
qr.add_data('xinxingzhao')
# img = qr.make('http://localhost:63342/Pytodos/xinxingzhao.svg?_ijt=cp6ogdol1ejnvqjaohb359nuke', image_factory=factory)

# img = qrcode.make('http://localhost:63342/Pytodos/xinxingzhao.svg?_ijt=cp6ogdol1ejnvqjaohb359nuke', image_factory=factory)
# img.save('xinxingzhao.svg')


qr.make(fit=True)
#
img = qr.make_image()
img.save('xinxingzhao.png')